<%-- 
    Document   : search
    Created on : Oct 16, 2011, 10:24:11 PM
    Author     : A7med Kotb
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Search Page</title>
        <script>
            var xmlhttp;    
            function change(){
                var searchtype = document.getElementById("type").value;
                var inputvalue=document.getElementById("inputvalue").value;
                if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp=new XMLHttpRequest();
                }
                else{// code for IE6, IE5
                    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange=handlechange;
                xmlhttp.open("GET","SearchISBNUPCURL.do?searchtype=" + searchtype +"&inputvalue="+inputvalue,true);
                xmlhttp.send();
            }
            function handlechange()
            {
                if(xmlhttp.readyState==4){
                    var divresult=document.getElementById("data");
                    divresult.innerHTML=xmlhttp.responseText;
                }
                
            }
        </script>
    </head>
    <body>
        <b>Search Type</b>
        <select id="type" >
            <option value="0">Select Search Type</option>
            <option value="isbn">By ISBN</option>
            <option value="upc">By UPC</option>
        </select>
        <input type="text" id="inputvalue"/>
        <input type="button" onclick="change();" VALUE="Search"/>
        <div id="data"></div>
    </body>
</html>
